<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label for="c-config_key" class="control-label col-xs-12 col-sm-2">配置键名:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-config_key" name="row[config_key]" type="text" class="form-control" placeholder="请输入配置键名，如：course_date_restriction">
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">配置名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" name="row[name]" type="text" class="form-control" placeholder="请输入配置名称">
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-description" class="control-label col-xs-12 col-sm-2">配置描述:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" name="row[description]" class="form-control" rows="3" placeholder="请输入配置描述"></textarea>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-restriction_type" class="control-label col-xs-12 col-sm-2">限制类型:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-restriction_type" name="row[restriction_type]" class="form-control">
                <option value="">请选择限制类型</option>
                <option value="workdays">仅工作日（周一至周五）</option>
                <option value="weekends">仅周末（周六、周日）</option>
                <option value="custom">自定义工作日</option>
                <option value="specific">指定日期</option>
                <option value="disabled">禁用日期</option>
            </select>
        </div>
    </div>

    <!-- 自定义工作日配置 -->
    <div class="form-group" id="custom-weekdays-group" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">允许的星期:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox-inline">
                <label><input type="checkbox" name="allowed_weekdays[]" value="0" class="weekday-checkbox"> 周日</label>
                <label><input type="checkbox" name="allowed_weekdays[]" value="1" class="weekday-checkbox"> 周一</label>
                <label><input type="checkbox" name="allowed_weekdays[]" value="2" class="weekday-checkbox"> 周二</label>
                <label><input type="checkbox" name="allowed_weekdays[]" value="3" class="weekday-checkbox"> 周三</label>
                <label><input type="checkbox" name="allowed_weekdays[]" value="4" class="weekday-checkbox"> 周四</label>
                <label><input type="checkbox" name="allowed_weekdays[]" value="5" class="weekday-checkbox"> 周五</label>
                <label><input type="checkbox" name="allowed_weekdays[]" value="6" class="weekday-checkbox"> 周六</label>
            </div>
        </div>
    </div>

    <!-- 指定日期配置 -->
    <div class="form-group" id="specific-dates-group" style="display: none;">
        <label for="c-allowed_dates" class="control-label col-xs-12 col-sm-2">允许的日期:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-allowed_dates" name="allowed_dates" class="form-control" rows="5" placeholder="请输入允许的日期，每行一个，格式：2024-01-15"></textarea>
            <small class="help-block">每行输入一个日期，格式为：YYYY-MM-DD</small>
        </div>
    </div>

    <!-- 禁用日期配置 -->
    <div class="form-group" id="disabled-dates-group" style="display: none;">
        <label for="c-disabled_dates" class="control-label col-xs-12 col-sm-2">禁用的日期:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-disabled_dates" name="disabled_dates" class="form-control" rows="5" placeholder="请输入禁用的日期，每行一个，格式：2024-01-15"></textarea>
            <small class="help-block">每行输入一个日期，格式为：YYYY-MM-DD</small>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
        <div class="col-xs-12 col-sm-8" id="div-status">
            <input id="c-status" name="row[status]" type="hidden" value="1">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher active" data-input-id="c-status" data-yes="1" data-no="0">
                <i class="fa fa-toggle-on text-success fa-2x"></i>
            </a>
            <div data-favisible="switch=1" class="p-3">正常</div>
            <div data-favisible="switch=0" class="p-3">禁用</div>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>